<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:p="http://primefaces.org/ui"
		xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head></h:head>

	<h:body>
        
        <div id="logoHomePage" align="left">
			<a href="homepage.xhtml"><img src="grafica\TravelDream_Logo.gif" width="150" height="75"/></a>
		</div>
		
		<div id="logout" align="right">
        	<h:form>
        	           	<a href="admin\index.xhtml">Pagina Amministrazione</a>
        	
				<h:commandButton action="#{logoutBean.logout}" value="Logout" />
			</h:form>
		</div>

		<div id="formModificaAlbergo">

			<h:form id="form">  
			  
			<p:growl id="growl" showDetail="true"/>  
			
			<p:tabView orientation="left">  
		    <p:tab title="ALBERGO"> 
			    <p:dataTable id="alberghi" var="a" value="#{prodottoBaseBean.alberghiDTO}" paginator="true" rows="10"  
			                 selection="#{prodottoBaseBean.nuovo}" selectionMode="single" rowKey="#{a.idProdottoBase}">  
			  
			        <p:ajax event="rowSelect" listener="#{prodottoBaseBean.onRowSelect}" 
			          	 update=":form:display :form:growl" oncomplete="PF('Dialog').show()"  />
			        <p:ajax event="rowUnselect" listener="#{prodottoBaseBean.onRowUnselect}" />  
			
			
			        <p:column headerText="NOME">  
			            #{a.nome}  
			        </p:column>  
			  
			        <p:column headerText="CITTA">  
			            #{a.citta}  
			        </p:column>  
			  
			        <p:column headerText="INDIRIZZO" >  
			            #{a.indirizzo}  
			        </p:column>  
			  
			        <p:column headerText="STELLE">  
			            #{a.stelle}  
			        </p:column>  
			    </p:dataTable>  
			  </p:tab>
			  	
			</p:tabView>  
			  
			    <p:dialog id="dialog" header="Dettagli Albergo" widgetVar="Dialog" resizable="false"  
			                showEffect="fade" hideEffect="explode">  
			  
			        <h:panelGrid id="display" columns="2" cellpadding="4">  
			  
			            <h:outputLabel for="nome">Nome:</h:outputLabel>
						<p:inputText id="nome" value="#{prodottoBaseBean.nuovo.nome}" />
						<p:message for="nome" />
						<h2></h2>
						<h:outputLabel for="citta">Citta:</h:outputLabel>
						<p:inputText id="citta" value="#{prodottoBaseBean.nuovo.citta}" />
						<p:message for="citta" />
						<h2></h2>
			            <h:outputLabel for="indirizzo">Indirizzo:</h:outputLabel>
						<p:inputText id="indirizzo" value="#{prodottoBaseBean.nuovo.indirizzo}" />
						<p:message for="indirizzo" />
						<h2></h2>
						<h:outputLabel for="stelle">Stelle:</h:outputLabel>
						<p:inputText id="stelle" value="#{prodottoBaseBean.nuovo.stelle}" />
						<p:message for="stelle" />
						<h2></h2>
						<p:selectOneRadio id="options" value="#{prodottoBaseBean.nuovo.tipoProdottoBase}">  
			       			<f:selectItem itemLabel="Albergo" itemValue="ALBERGO" />  
			       	     	<f:selectItem itemLabel="Volo" itemValue="VOLO" />  
			       	     	<f:selectItem itemLabel="Escursione" itemValue="ESCURSIONE" />  
			      	  	</p:selectOneRadio>  
						<h2></h2>
						<p:commandButton value="ConfermaModifica"
							action="#{prodottoBaseBean.modify()}" />

			        </h:panelGrid>  
			    </p:dialog> 
			    			
			</h:form>  
       
		</div>
		
    </h:body>
</html>
